﻿<%@ WebHandler Language="C#" Class="GetQf" %>

using System;
using System.Web;
using BLL;
public class GetQf : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";


        string sql = "select  count(id)  from Tb_UserProperty a where ((select isnull(sum(c.Total),0) from Tbl_WayBill c where c.AccountNo=a.AccountNo and c.stateid<>1)-(select isnull(sum(b.PayAll ),0) from Tb_Pay b where  b.userid=a.userid))-ArrearsLimit> a.Accountbalance and a.UserID<>1 and a.ArrearsLimit<1000";

        string value = new PublicSqlService().ExecuteScalar(sql).ToString();
        context.Response.Write(value);
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}